<link href="../../css/style.css" rel="stylesheet" type="text/css">
<link href="../../css/estrutura.css" rel="stylesheet" type="text/css">

<div id="barra-painel" style="width:99%; margin:0px">
<?php 
include "../../jerimum/classes/bd.php";
$anuncio	= $_GET["id"];
?>
<fieldset>


<form action="cad-fotos.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="anuncio" value="<?php echo $anuncio; ?>">

<legend style="font-size:20px;">Fotos</legend>

Selecione m&uacute;ltiplos arquivos usando a tecla CTRL.<br />
<input name="imagens[]" type="file" multiple="" />
<input name="Adicionar imagens" type="submit" class="butao_sub" value="Adicionar imagens" />


</form>
<br>

<?php 
$sql	= mysql_query("SELECT * FROM fotos_anuncios WHERE anuncio = '$anuncio'");
$num	= mysql_num_rows($sql);

if($num == 0){

echo "N&atilde;o existe fotos cadastrada";

}else{
while($rows = mysql_fetch_array($sql)){
?>
<div style="border:solid 1px #CCC; width:80px; margin-left:8px; float:left">

<div align="center"><img src="/imagem.php?imagem=imagens/produtos/<?php echo $rows["foto"]; ?>&w=80&h=65"/></div>
    <br />

<div style="padding:5px" align="center"><a href="apaga-foto.php?sessao=<?php echo base64_encode($rows["id"]); ?>&temp=<?=base64_encode($anuncio)?>&anuncio=<?=$anuncio?>&foto=<?php echo $rows["foto"]; ?>" onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'" style="color:#F00; cursor:pointer" value="apagar" onclick="javascript: if(confirm('Deseja realmente deletar essa imagem?')){return true;}else{return false;}" />apagar</a>
<br />
<input onclick="location.href='destaca-foto.php?sessao=<?php echo base64_encode($rows["id"]); ?>&temp=<?=base64_encode($anuncio)?>&anuncio=<?=$anuncio?>&foto=<?php echo $rows["foto"]; ?>'" type="checkbox" id="fotoanun_<?php echo $rows["id"]; ?>" <?php if($rows["destaque"]==1){echo "checked"; }else{ echo ""; } ?> /> 
Destacar
</div>


</div>
<?php } } ?>

</fieldset>
</div>